package estimators.numberoOfDocuments;

import distributedRE.model.QueryDatabase;

public class GlossEstimator extends NumberOfDocumentCalculator {

	@Override
	protected double getMustNotProbability(String term, QueryDatabase qdb) {
		
		
		
		long frequency = qdb.getFrequency(term,false);
		
		long size = qdb.getNumberOfDocuments();
		
		return (double)(size - frequency)/(double)size;		
		
	}

	@Override
	protected double getMustProbability(String term, QueryDatabase qdb) {
		
		long frequency = qdb.getFrequency(term,true);
		
		long size = qdb.getNumberOfDocuments();
		
		return (double)frequency/(double)size;
	}

	public String toString(){
		return "Gloss Estimator";
	}

}
